load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "go_default_library",
    srcs = [
        "http.go",
        "metrics.go",
        "push.go",
    ],
    importpath = "k8s.io/test-infra/prow/metrics",
    visibility = ["//visibility:public"],
    deps = [
        "//prow/config:go_default_library",
        "//prow/interrupts:go_default_library",
        "//prow/simplifypath:go_default_library",
        "@com_github_prometheus_client_golang//prometheus:go_default_library",
        "@com_github_prometheus_client_golang//prometheus/promhttp:go_default_library",
        "@com_github_prometheus_common//expfmt:go_default_library",
        "@com_github_prometheus_common//model:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_sigs_controller_runtime//pkg/metrics:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//prow/metrics/prowjobs:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "go_default_test",
    srcs = [
        "http_test.go",
        "metrics_test.go",
    ],
    embed = [":go_default_library"],
    deps = [
        "//prow/config:go_default_library",
        "//prow/flagutil:go_default_library",
        "//prow/interrupts:go_default_library",
        "//prow/simplifypath:go_default_library",
        "@com_github_prometheus_client_golang//prometheus/testutil:go_default_library",
        "@io_k8s_utils//diff:go_default_library",
    ],
)
